#include<iostream>
using namespace std;
int n,t;

int main(){
	cin>>n>>t;
	if(n==0 || t==0){
		cout<<0<<endl;
		return 0;
	}
	t-=1;
	int ans = 1;
	int last=0;
	cin>>last;
	last+=t;
	ans+=t;
	int tmp=0;
	for(int i=2;i<=n;i++){
		cin>>tmp;
		if(tmp+t>last){
			if(tmp+t-last>=t+1){
				last=tmp+t;
				ans=ans+t+1;
			}else{
				ans+=tmp+t-last;
				last=tmp+t;
			}		
		}
	}
	cout<<ans<<endl;
	return 0;
}